/*
*	Glideplayer Proof of Concept
*	
*	What are blocking issues?
*	- crossdomain.xml is a file which must be present on remote servers for flash to get it.
*		- e.g. New york times is accessible where bbc news is not
*		- apparently yahoo pipes is an option...
*/
package 
{
	import flash.display.Sprite;
	import flash.display.*;
	import flash.events.*;
	import flash.system.Security;


	import flash.external.*;
 
	[SWF(height="385",width="640")]
	public class GlidePlayer extends Sprite
	{
		private var _gcid:String;
		
		private var _gcmodel:GlideCastModel;
		private var _gccontroller:GlideCastController;
		private var _gcview:GlideCastView;
		
	 	public function GlidePlayer()
		{
			super();
			initmvc();
			/*
				In future, if there is a need to interact with this object from
				javascript, the following is how you do it:
				
				ExternalInterface.addCallback("fullScreen", fullScreen);
				
				where fullScreen is a function in this class.
			*/
			
			 
		}public function initmvc():void
		{
			var globalParam:Object = LoaderInfo(this.root.loaderInfo).parameters;
			_gcid = "10";
			for (var element:String in globalParam)
			{
				if (element == '_gcid')
				{
					_gcid =   globalParam[element];
				}
			}
			
			_gcmodel=new GlideCastModel(_gcid);
			_gccontroller=new GlideCastController(_gcmodel);
			_gcview=new GlideCastView(_gcmodel,_gccontroller);

			addChild(_gcview);

			_gccontroller.load(_gcid);
		}
		
 	}
}
